home *** CD-ROM | disk | FTP | other *** search
- {{{ Notes about this keybinding
- ; These bindings are an experimental version for writing C programs in an
- ; Emacs-like environment. At the moment, they are only similar to real
- ; Emacs c-mode, but I am still working... My idea is to have an editor
- ; which saves me from typing bothering things, which supports a few aspects of
- ; C syntax but does not restrict one like a syntax-controlled editor does.
- ; If you have any ideas what could be useful for these bindings, write me
- ; a mail. You will not find any documentation for these bindings - look
- ; at the OCL code and try working with it. As I said: an experimental
- ; version.
- ;
- ; Michael Haardt (mhaardt@ftp.thp.uni-koeln.de)
- }}}
-
- {{{ these bindings are named C-Emacs
- (defbinding C-Emacs)
- }}}
- {{{ moving cursor
- (keybind backward-character (C-B))
- (keybind backward-character ($left))
- (keybind forward-character (C-F))
- (keybind forward-character ($right))
- (keybind previous-line (C-P))
- (keybind previous-line ($up))
- (keybind next-line (C-N))
- (keybind next-line ($down))
-
- (keybind backward-word (M-"b))
- (keybind forward-word (M-"f))
-
- (keybind beginning-of-line (C-A))
- (keybind end-of-line (C-E))
- (keybind beginning-of-fold (M-"<))
- (keybind end-of-fold (M-">))
-
- (keybind previous-page (M-"v))
- (keybind previous-page ($prev_page))
- (keybind next-page (C-V))
- (keybind next-page ($next_page))
-
- (keybind goto-line (M-"g))
- }}}
- {{{ folding
- (keybind open-fold (C-O))
- (keybind close-fold (C-C))
- (keybind enter-fold (M-C-O))
- (keybind exit-fold (M-C-C))
- (keybind unfold-fold (C-U))
- (keybind create-fold (M-C-N))
- (keybind create-auto-fold (M-C-A C-N))
- (keybind auto-header (M-C-A C-H))
- (keybind toggle-create-file-fold (C-X "a "c))
- (keybind open-file-fold (C-X "a "o))
- }}}
- {{{ editing
- (keybind newline-and-indent (C-J))
- (keybind newline-and-indent (C-M))
-
- (keybind delete-previous-character (C-H))
- (keybind delete-character (C-D))
- (keybind delete-character (C-?))
-
- (keybind transpose-characters (C-T))
-
- (keybind case-word-capitalize (M-"c))
- (keybind case-word-lower (M-"l))
- (keybind case-word-upper (M-"u))
-
- (keybind delete-to-end-of-line (C-K))
- (keybind delete-line (C-X C-K))
- (keybind undo-delete-line (C-X C-Y))
- (keybind kill-line (M-C-K))
- (keybind copy-to-kill-buffer (M-"w))
- (keybind fold-kill-buffer (C-Y))
- }}}
- {{{ search & replace
- (keybind search-forward (C-S))
- (keybind search-reverse (C-R))
-
- (keybind incremental-search (C-X "s))
- (keybind reverse-incremental-search (C-X "r))
-
- (keybind replace-string (M-"r))
- (keybind query-replace-string (M-C-R))
- }}}
- {{{ files
- (keybind insert-file (C-X C-I))
- (keybind save-file (C-X C-S))
- (keybind write-file (C-X C-W))
- (keybind read-file (C-X C-R))
- (keybind next-file (C-X C-N))
- (keybind previous-file (C-X C-P))
- }}}
- {{{ macros
- (keybind define-macro (C-X "())
- (keybind define-macro (C-X ")))
- (keybind execute-macro (C-X "e))
- }}}
- {{{ shell commands
- (keybind i-shell (C-X "c))
- (keybind shell-command (C-X "!))
- }}}
- {{{ modes
- (keybind add-mode-view (C-X "m "v))
- (keybind delete-mode-view (C-X C-M "v))
-
- (keybind add-mode-overwrite (C-X "m "o))
- (keybind delete-mode-overwrite (C-X C-M "o))
-
- (keybind add-mode-autosave (C-X "m "a))
- (keybind delete-mode-autosave (C-X C-M "a))
-
- (keybind set-language (C-X "m "l))
- }}}
- {{{ arguments
- (keybind set-argument-0 (M-"0))
- (keybind set-argument-1 (M-"1))
- (keybind set-argument-2 (M-"2))
- (keybind set-argument-3 (M-"3))
- (keybind set-argument-4 (M-"4))
- (keybind set-argument-5 (M-"5))
- (keybind set-argument-6 (M-"6))
- (keybind set-argument-7 (M-"7))
- (keybind set-argument-8 (M-"8))
- (keybind set-argument-9 (M-"9))
- }}}
- {{{ special functions
- (keybind abort (C-G))
-
- (keybind redraw-display (C-L))
-
- (keybind quote-character (C-Q))
-
- (keybind help (M-"?))
- (keybind describe-bindings (C-X "?))
- (keybind describe-fold (C-X "=))
- }}}
- {{{ how to get out
- (keybind exit-origami (C-X C-C))
- (keybind quick-exit (M-"z))
- }}}
-
- {{{ compile-it
- {{{F compile.fun
- :::F compile.fun
- }}}
-
- (keybind compile-it (M-"! "m))
- }}}
- {{{ version-control
- {{{F version.fun
- :::F version.fun
- }}}
-
- (keybind check-out (M-"! "c "o))
- (keybind check-in (M-"! "c "i))
- }}}
- {{{ goto-matching-fence
- {{{F go-match.fun
- :::F go-match.fun
- }}}
-
- (keybind goto-matching-fence (M-C-F))
- }}}
- {{{ beautify-c-code
- (deffun beautify-c-code
- (
- filter-buffer "cb newline-and-indent
- ))
-
- (keybind beautify-c-code (M-"i))
- }}}
-
- {{{ parens
- (deffun paired-parens
- (
- "( ")
- backward-character
- ))
- (keybind paired-parens ("( ))
- }}}
- {{{ brackets
- (deffun paired-brackets
- (
- "[]
- backward-character
- ))
- (keybind paired-brackets ("[ ))
- }}}
- {{{ curly brackets
- (deffun paired-curly-brackets
- (
- {{{ corrrect position?!
- store-pos x_pos_cb
- beginning-of-line
- if test-char " (
- goto-counter x_pos_cb
- ) else (
- end-of-line
- newline-and-indent
- ) fi
- }}}
- "{
- newline-and-indent
- "}
- previous-line
- end-of-line
- newline-and-indent
- forward-character forward-character
- ))
- (keybind paired-curly-brackets ("{ ))
- }}}
- {{{ doublequotes
- (deffun paired-doublequotes
- (
- "" ""
- backward-character
- ))
- (keybind paired-doublequotes ("" ))
- }}}
- {{{ singlequotes
- (deffun paired-singlequotes
- (
- "' "'
- backward-character
- ))
- (keybind paired-singlequotes ("' ))
- }}}
- {{{ semicolon
- (deffun semicolon (
- end-of-line
- O_LEFT
- if not(test-char ";) (
- if not(test-char " ) (O_RIGHT) fi
- ";
- ) fi
- beginning-of-line
- store-pos x_pos_sem
- O_DOWN
- beginning-of-line
- if test-char " (
- O_UP beginning-of-line O_DOWN
- ) else (
- store-pos x2_pos_sem
- inv-counter x2_pos_sem
- sum-counter x_pos_sem x2_pos_sem
- if counter>0 x_pos_sem (O_UP end-of-line O_RETURN) fi
- ) fi
- ))
- (keybind semicolon (";))
- }}}
-